home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / content / nsISelectElement.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  10KB  |  213 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISelectElement.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISelectElement_h__
  6. #define __gen_nsISelectElement_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIContent; /* forward declaration */
  18.  
  19. class nsIDOMHTMLOptionElement; /* forward declaration */
  20.  
  21. class nsPresContext; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsISelectElement */
  25. #define NS_ISELECTELEMENT_IID_STR "35bd8ed5-5f34-4126-8c4f-38ba01681836"
  26.  
  27. #define NS_ISELECTELEMENT_IID \
  28.   {0x35bd8ed5, 0x5f34, 0x4126, \
  29.     { 0x8c, 0x4f, 0x38, 0xba, 0x01, 0x68, 0x18, 0x36 }}
  30.  
  31. /** 
  32.  * This interface is used to notify a SELECT when OPTION
  33.  * elements are added and removed from its subtree.
  34.  * Note that the nsIDOMHTMLSelectElement and nsIContent 
  35.  * interfaces are the ones to use to access and enumerate
  36.  * OPTIONs within a SELECT element.
  37.  */
  38. class NS_NO_VTABLE nsISelectElement : public nsISupports {
  39.  public: 
  40.  
  41.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISELECTELEMENT_IID)
  42.  
  43.   /**
  44.    * To be called when stuff is added under a child of the select--but *before*
  45.    * they are actually added.
  46.    *
  47.    * @param aOptions the content that was added (usually just an option, but
  48.    *        could be an optgroup node with many child options)
  49.    * @param aParent the parent the options were added to (could be an optgroup)
  50.    * @param aContentIndex the index where the options are being added within the
  51.    *        parent (if the parent is an optgroup, the index within the optgroup)
  52.    */
  53.   /* [noscript] void willAddOptions (in nsIContent aOptions, in nsIContent aParent, in long aContentIndex); */
  54.   NS_IMETHOD WillAddOptions(nsIContent *aOptions, nsIContent *aParent, PRInt32 aContentIndex) = 0;
  55.  
  56.   /**
  57.    * To be called when stuff is removed under a child of the select--but
  58.    * *before* they are actually removed.
  59.    *
  60.    * @param aParent the parent the option(s) are being removed from
  61.    * @param aContentIndex the index of the option(s) within the parent (if the
  62.    *        parent is an optgroup, the index within the optgroup)
  63.    */
  64.   /* [noscript] void willRemoveOptions (in nsIContent aParent, in long aContentIndex); */
  65.   NS_IMETHOD WillRemoveOptions(nsIContent *aParent, PRInt32 aContentIndex) = 0;
  66.  
  67.   /**
  68.    * Checks whether an option is disabled (even if it's part of an optgroup)
  69.    *
  70.    * @param aIndex the index of the option to check
  71.    * @return whether the option is disabled
  72.    */
  73.   /* boolean isOptionDisabled (in long aIndex); */
  74.   NS_IMETHOD IsOptionDisabled(PRInt32 aIndex, PRBool *_retval) = 0;
  75.  
  76.   /**
  77.    * Sets multiple options (or just sets startIndex if select is single)
  78.    * and handles notifications and cleanup and everything under the sun.
  79.    * When this method exits, the select will be in a consistent state.  i.e.
  80.    * if you set the last option to false, it will select an option anyway.
  81.    *
  82.    * @param aStartIndex the first index to set
  83.    * @param aEndIndex the last index to set (set same as first index for one
  84.    *        option)
  85.    * @param aIsSelected whether to set the option(s) to true or false
  86.    * @param aClearAll whether to clear all other options (for example, if you
  87.    *        are normal-clicking on the current option)
  88.    * @param aSetDisabled whether it is permissible to set disabled options
  89.    *        (for JavaScript)
  90.    * @param aNotify whether to notify frames and such
  91.    * @return whether any options were actually changed
  92.    */
  93.   /* boolean setOptionsSelectedByIndex (in long aStartIndex, in long aEndIndex, in boolean aIsSelected, in boolean aClearAll, in boolean aSetDisabled, in boolean aNotify); */
  94.   NS_IMETHOD SetOptionsSelectedByIndex(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aIsSelected, PRBool aClearAll, PRBool aSetDisabled, PRBool aNotify, PRBool *_retval) = 0;
  95.  
  96.   /**
  97.    * Finds the index of a given option element
  98.    *
  99.    * @param aOption the option to get the index of
  100.    * @param aStartIndex the index to start looking at
  101.    * @param aForward TRUE to look forward, FALSE to look backward
  102.    * @return the option index
  103.    */
  104.   /* long getOptionIndex (in nsIDOMHTMLOptionElement aOption, in long aStartIndex, in boolean aForward); */
  105.   NS_IMETHOD GetOptionIndex(nsIDOMHTMLOptionElement *aOption, PRInt32 aStartIndex, PRBool aForward, PRInt32 *_retval) = 0;
  106.  
  107.   /** Whether or not there are optgroups in this select */
  108.   /* readonly attribute boolean hasOptGroups; */
  109.   NS_IMETHOD GetHasOptGroups(PRBool *aHasOptGroups) = 0;
  110.  
  111. };
  112.  
  113. /* Use this macro when declaring classes that implement this interface. */
  114. #define NS_DECL_NSISELECTELEMENT \
  115.   NS_IMETHOD WillAddOptions(nsIContent *aOptions, nsIContent *aParent, PRInt32 aContentIndex); \
  116.   NS_IMETHOD WillRemoveOptions(nsIContent *aParent, PRInt32 aContentIndex); \
  117.   NS_IMETHOD IsOptionDisabled(PRInt32 aIndex, PRBool *_retval); \
  118.   NS_IMETHOD SetOptionsSelectedByIndex(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aIsSelected, PRBool aClearAll, PRBool aSetDisabled, PRBool aNotify, PRBool *_retval); \
  119.   NS_IMETHOD GetOptionIndex(nsIDOMHTMLOptionElement *aOption, PRInt32 aStartIndex, PRBool aForward, PRInt32 *_retval); \
  120.   NS_IMETHOD GetHasOptGroups(PRBool *aHasOptGroups); 
  121.  
  122. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  123. #define NS_FORWARD_NSISELECTELEMENT(_to) \
  124.   NS_IMETHOD WillAddOptions(nsIContent *aOptions, nsIContent *aParent, PRInt32 aContentIndex) { return _to WillAddOptions(aOptions, aParent, aContentIndex); } \
  125.   NS_IMETHOD WillRemoveOptions(nsIContent *aParent, PRInt32 aContentIndex) { return _to WillRemoveOptions(aParent, aContentIndex); } \
  126.   NS_IMETHOD IsOptionDisabled(PRInt32 aIndex, PRBool *_retval) { return _to IsOptionDisabled(aIndex, _retval); } \
  127.   NS_IMETHOD SetOptionsSelectedByIndex(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aIsSelected, PRBool aClearAll, PRBool aSetDisabled, PRBool aNotify, PRBool *_retval) { return _to SetOptionsSelectedByIndex(aStartIndex, aEndIndex, aIsSelected, aClearAll, aSetDisabled, aNotify, _retval); } \
  128.   NS_IMETHOD GetOptionIndex(nsIDOMHTMLOptionElement *aOption, PRInt32 aStartIndex, PRBool aForward, PRInt32 *_retval) { return _to GetOptionIndex(aOption, aStartIndex, aForward, _retval); } \
  129.   NS_IMETHOD GetHasOptGroups(PRBool *aHasOptGroups) { return _to GetHasOptGroups(aHasOptGroups); } 
  130.  
  131. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  132. #define NS_FORWARD_SAFE_NSISELECTELEMENT(_to) \
  133.   NS_IMETHOD WillAddOptions(nsIContent *aOptions, nsIContent *aParent, PRInt32 aContentIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->WillAddOptions(aOptions, aParent, aContentIndex); } \
  134.   NS_IMETHOD WillRemoveOptions(nsIContent *aParent, PRInt32 aContentIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->WillRemoveOptions(aParent, aContentIndex); } \
  135.   NS_IMETHOD IsOptionDisabled(PRInt32 aIndex, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsOptionDisabled(aIndex, _retval); } \
  136.   NS_IMETHOD SetOptionsSelectedByIndex(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aIsSelected, PRBool aClearAll, PRBool aSetDisabled, PRBool aNotify, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOptionsSelectedByIndex(aStartIndex, aEndIndex, aIsSelected, aClearAll, aSetDisabled, aNotify, _retval); } \
  137.   NS_IMETHOD GetOptionIndex(nsIDOMHTMLOptionElement *aOption, PRInt32 aStartIndex, PRBool aForward, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOptionIndex(aOption, aStartIndex, aForward, _retval); } \
  138.   NS_IMETHOD GetHasOptGroups(PRBool *aHasOptGroups) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasOptGroups(aHasOptGroups); } 
  139.  
  140. #if 0
  141. /* Use the code below as a template for the implementation class for this interface. */
  142.  
  143. /* Header file */
  144. class nsSelectElement : public nsISelectElement
  145. {
  146. public:
  147.   NS_DECL_ISUPPORTS
  148.   NS_DECL_NSISELECTELEMENT
  149.  
  150.   nsSelectElement();
  151.  
  152. private:
  153.   ~nsSelectElement();
  154.  
  155. protected:
  156.   /* additional members */
  157. };
  158.  
  159. /* Implementation file */
  160. NS_IMPL_ISUPPORTS1(nsSelectElement, nsISelectElement)
  161.  
  162. nsSelectElement::nsSelectElement()
  163. {
  164.   /* member initializers and constructor code */
  165. }
  166.  
  167. nsSelectElement::~nsSelectElement()
  168. {
  169.   /* destructor code */
  170. }
  171.  
  172. /* [noscript] void willAddOptions (in nsIContent aOptions, in nsIContent aParent, in long aContentIndex); */
  173. NS_IMETHODIMP nsSelectElement::WillAddOptions(nsIContent *aOptions, nsIContent *aParent, PRInt32 aContentIndex)
  174. {
  175.     return NS_ERROR_NOT_IMPLEMENTED;
  176. }
  177.  
  178. /* [noscript] void willRemoveOptions (in nsIContent aParent, in long aContentIndex); */
  179. NS_IMETHODIMP nsSelectElement::WillRemoveOptions(nsIContent *aParent, PRInt32 aContentIndex)
  180. {
  181.     return NS_ERROR_NOT_IMPLEMENTED;
  182. }
  183.  
  184. /* boolean isOptionDisabled (in long aIndex); */
  185. NS_IMETHODIMP nsSelectElement::IsOptionDisabled(PRInt32 aIndex, PRBool *_retval)
  186. {
  187.     return NS_ERROR_NOT_IMPLEMENTED;
  188. }
  189.  
  190. /* boolean setOptionsSelectedByIndex (in long aStartIndex, in long aEndIndex, in boolean aIsSelected, in boolean aClearAll, in boolean aSetDisabled, in boolean aNotify); */
  191. NS_IMETHODIMP nsSelectElement::SetOptionsSelectedByIndex(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aIsSelected, PRBool aClearAll, PRBool aSetDisabled, PRBool aNotify, PRBool *_retval)
  192. {
  193.     return NS_ERROR_NOT_IMPLEMENTED;
  194. }
  195.  
  196. /* long getOptionIndex (in nsIDOMHTMLOptionElement aOption, in long aStartIndex, in boolean aForward); */
  197. NS_IMETHODIMP nsSelectElement::GetOptionIndex(nsIDOMHTMLOptionElement *aOption, PRInt32 aStartIndex, PRBool aForward, PRInt32 *_retval)
  198. {
  199.     return NS_ERROR_NOT_IMPLEMENTED;
  200. }
  201.  
  202. /* readonly attribute boolean hasOptGroups; */
  203. NS_IMETHODIMP nsSelectElement::GetHasOptGroups(PRBool *aHasOptGroups)
  204. {
  205.     return NS_ERROR_NOT_IMPLEMENTED;
  206. }
  207.  
  208. /* End of implementation class template. */
  209. #endif
  210.  
  211.  
  212. #endif /* __gen_nsISelectElement_h__ */
  213.